package guoanmaker.operator.business.repository;

import guoanmaker.operator.business.model.OperatorActivityType;
import guoanmaker.operator.business.model.OperatorCouponPage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 *  
 *
 * @author huZhaoyu 
 * @ClassName: OperatorActivityTypeRepository
 * @Description: 活动类型Repository
 * @date 2017/6/29
 */
public interface OperatorActivityTypeRepository extends JpaRepository<OperatorActivityType, String>, JpaSpecificationExecutor<OperatorActivityType> {
    //	@Query("select u from OperatorUser u left join fetch u.roles r where u.username=:username")
//    public Optional<OperatorUser> findByUsername(@Param("username") String username);
    Integer countAllByIdIsNotNull();
    @Query("select at from OperatorActivityType at where 1=1 order by at.typeNo asc ")
	public List<OperatorActivityType>  getAllActivityType();
}